Optimal. Leaf size=91 \[ \frac {b (d f-e g) n x}{2 e}-\frac {b n (g+f x)^2}{4 f}-\frac {b (d f-e g)^2 n \log (d+e x)}{2 e^2 f}+\frac {(g+f x)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )}{2 f} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.05, antiderivative size = 91, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 3, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.130, Rules used = {2459, 2442, 45}
\begin {gather*} \frac {(f x+g)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )}{2 f}-\frac {b n (d f-e g)^2 \log (d+e x)}{2 e^2 f}+\frac {b n x (d f-e g)}{2 e}-\frac {b n (f x+g)^2}{4 f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 45
Rule 2442
Rule 2459
Rubi steps
\begin {align*} \int \left (f+\frac {g}{x}\right ) x \left (a+b \log \left (c (d+e x)^n\right )\right ) \, dx &=\int (g+f x) \left (a+b \log \left (c (d+e x)^n\right )\right ) \, dx\\ &=\frac {(g+f x)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )}{2 f}-\frac {(b e n) \int \frac {(g+f x)^2}{d+e x} \, dx}{2 f}\\ &=\frac {(g+f x)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )}{2 f}-\frac {(b e n) \int \left (\frac {f (-d f+e g)}{e^2}+\frac {(-d f+e g)^2}{e^2 (d+e x)}+\frac {f (g+f x)}{e}\right ) \, dx}{2 f}\\ &=\frac {b (d f-e g) n x}{2 e}-\frac {b n (g+f x)^2}{4 f}-\frac {b (d f-e g)^2 n \log (d+e x)}{2 e^2 f}+\frac {(g+f x)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )}{2 f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.05, size = 101, normalized size = 1.11 \begin {gather*} a g x+\frac {b d f n x}{2 e}-b g n x+\frac {1}{2} a f x^2-\frac {1}{4} b f n x^2-\frac {b d^2 f n \log (d+e x)}{2 e^2}+\frac {1}{2} b f x^2 \log \left (c (d+e x)^n\right )+\frac {b g (d+e x) \log \left (c (d+e x)^n\right )}{e} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.35, size = 101, normalized size = 1.11
method | result | size |
default | \(a g x +\frac {a f \,x^{2}}{2}+b g \ln \left (c \left (e x +d \right )^{n}\right ) x -b g n x +\frac {b g n d \ln \left (e x +d \right )}{e}+\frac {b f \,x^{2} \ln \left (c \,{\mathrm e}^{n \ln \left (e x +d \right )}\right )}{2}-\frac {n b f \,x^{2}}{4}-\frac {n b \,d^{2} f \ln \left (e x +d \right )}{2 e^{2}}+\frac {b d f n x}{2 e}\) | \(101\) |
risch | \(\frac {b x \left (f x +2 g \right ) \ln \left (\left (e x +d \right )^{n}\right )}{2}+\frac {i \pi b g x \,\mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i c \left (e x +d \right )^{n}\right )^{2}}{2}+\frac {i \pi b f \,x^{2} \mathrm {csgn}\left (i \left (e x +d \right )^{n}\right ) \mathrm {csgn}\left (i c \left (e x +d \right )^{n}\right )^{2}}{4}-\frac {i \pi b f \,x^{2} \mathrm {csgn}\left (i c \left (e x +d \right )^{n}\right )^{3}}{4}+\frac {i \pi b f \,x^{2} \mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i c \left (e x +d \right )^{n}\right )^{2}}{4}-\frac {i \pi b g x \mathrm {csgn}\left (i c \left (e x +d \right )^{n}\right )^{3}}{2}-\frac {i \pi b g x \,\mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i \left (e x +d \right )^{n}\right ) \mathrm {csgn}\left (i c \left (e x +d \right )^{n}\right )}{2}+\frac {i \pi b g x \,\mathrm {csgn}\left (i \left (e x +d \right )^{n}\right ) \mathrm {csgn}\left (i c \left (e x +d \right )^{n}\right )^{2}}{2}-\frac {i \pi b f \,x^{2} \mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i \left (e x +d \right )^{n}\right ) \mathrm {csgn}\left (i c \left (e x +d \right )^{n}\right )}{4}+\frac {\ln \left (c \right ) b f \,x^{2}}{2}-\frac {n b f \,x^{2}}{4}-\frac {n b \,d^{2} f \ln \left (e x +d \right )}{2 e^{2}}+\frac {b g n d \ln \left (e x +d \right )}{e}+\ln \left (c \right ) b g x +\frac {a f \,x^{2}}{2}+\frac {b d f n x}{2 e}-b g n x +a g x\) | \(338\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.26, size = 104, normalized size = 1.14 \begin {gather*} -\frac {1}{4} \, {\left (2 \, d^{2} e^{\left (-3\right )} \log \left (x e + d\right ) + {\left (x^{2} e - 2 \, d x\right )} e^{\left (-2\right )}\right )} b f n e + {\left (d e^{\left (-2\right )} \log \left (x e + d\right ) - x e^{\left (-1\right )}\right )} b g n e + \frac {1}{2} \, b f x^{2} \log \left ({\left (x e + d\right )}^{n} c\right ) + \frac {1}{2} \, a f x^{2} + b g x \log \left ({\left (x e + d\right )}^{n} c\right ) + a g x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.35, size = 105, normalized size = 1.15 \begin {gather*} \frac {1}{4} \, {\left (2 \, b d f n x e + 2 \, {\left (b f x^{2} + 2 \, b g x\right )} e^{2} \log \left (c\right ) - {\left ({\left (b f n - 2 \, a f\right )} x^{2} + 4 \, {\left (b g n - a g\right )} x\right )} e^{2} - 2 \, {\left (b d^{2} f n - 2 \, b d g n e - {\left (b f n x^{2} + 2 \, b g n x\right )} e^{2}\right )} \log \left (x e + d\right )\right )} e^{\left (-2\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.69, size = 134, normalized size = 1.47 \begin {gather*} \begin {cases} \frac {a f x^{2}}{2} + a g x - \frac {b d^{2} f \log {\left (c \left (d + e x\right )^{n} \right )}}{2 e^{2}} + \frac {b d f n x}{2 e} + \frac {b d g \log {\left (c \left (d + e x\right )^{n} \right )}}{e} - \frac {b f n x^{2}}{4} + \frac {b f x^{2} \log {\left (c \left (d + e x\right )^{n} \right )}}{2} - b g n x + b g x \log {\left (c \left (d + e x\right )^{n} \right )} & \text {for}\: e \neq 0 \\\left (a + b \log {\left (c d^{n} \right )}\right ) \left (\frac {f x^{2}}{2} + g x\right ) & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 186 vs.
\(2 (85) = 170\).
time = 4.36, size = 186, normalized size = 2.04 \begin {gather*} \frac {1}{2} \, {\left (x e + d\right )}^{2} b f n e^{\left (-2\right )} \log \left (x e + d\right ) - {\left (x e + d\right )} b d f n e^{\left (-2\right )} \log \left (x e + d\right ) - \frac {1}{4} \, {\left (x e + d\right )}^{2} b f n e^{\left (-2\right )} + {\left (x e + d\right )} b d f n e^{\left (-2\right )} + {\left (x e + d\right )} b g n e^{\left (-1\right )} \log \left (x e + d\right ) + \frac {1}{2} \, {\left (x e + d\right )}^{2} b f e^{\left (-2\right )} \log \left (c\right ) - {\left (x e + d\right )} b d f e^{\left (-2\right )} \log \left (c\right ) - {\left (x e + d\right )} b g n e^{\left (-1\right )} + \frac {1}{2} \, {\left (x e + d\right )}^{2} a f e^{\left (-2\right )} - {\left (x e + d\right )} a d f e^{\left (-2\right )} + {\left (x e + d\right )} b g e^{\left (-1\right )} \log \left (c\right ) + {\left (x e + d\right )} a g e^{\left (-1\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.27, size = 104, normalized size = 1.14 \begin {gather*} x\,\left (\frac {2\,a\,d\,f+2\,a\,e\,g-2\,b\,e\,g\,n}{2\,e}-\frac {d\,f\,\left (2\,a-b\,n\right )}{2\,e}\right )+\ln \left (c\,{\left (d+e\,x\right )}^n\right )\,\left (\frac {b\,f\,x^2}{2}+b\,g\,x\right )-\frac {\ln \left (d+e\,x\right )\,\left (b\,d^2\,f\,n-2\,b\,d\,e\,g\,n\right )}{2\,e^2}+\frac {f\,x^2\,\left (2\,a-b\,n\right )}{4} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________